import { defineStore } from 'pinia'
import { ref } from 'vue'
import service from '../utils/request'
import { ElMessage } from 'element-plus'

export const useConferenceStore = defineStore('/customer/rooms', () => {
    const conferenceList = ref([])
    const getConferenceList = async (screening) => {
        if (screening) {
            const res = await service.put('/customer/rooms',  screening )
            if (res.data.code === 200) {
                conferenceList.value = res.data.data
                // console.log(conferenceList.value); // 打印 conferenceList 的值，以便检查其内容是否正确设置
                return conferenceList.value
            } else {
                ElMessage.error(res.data.message)
            }
            return
        }else{
           ElMessage.error('请输入筛选条件') 
        }

    }
    return { conferenceList, getConferenceList }
})